﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbFullSubentPath : OdDbBaseFullSubentPath
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbFullSubentPath(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbFullSubentPath_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbFullSubentPath obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbFullSubentPath()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbFullSubentPath(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdDbFullSubentPath() : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_0(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath(SubentType type, IntPtr index) : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_1((int)type, index), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath(OdDbObjectId entId, OdDbSubentId subId) : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_2(OdDbObjectId.getCPtr(entId), OdDbSubentId.getCPtr(subId)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath(OdDbObjectId entId, SubentType type, IntPtr index) : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_3(OdDbObjectId.getCPtr(entId), (int)type, index), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath(OdDbObjectIdArray objectIds, OdDbSubentId subId) : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_4(OdDbObjectIdArray.getCPtr(objectIds), OdDbSubentId.getCPtr(subId)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath(OdDbStubPtrArray objectIds, OdDbSubentId subId) : this(TD_DbPINVOKE.new_OdDbFullSubentPath__SWIG_5(OdDbStubPtrArray.getCPtr(objectIds), OdDbSubentId.getCPtr(subId)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void objectIds(OdDbObjectIdArray objectIdsArg)
		{
			TD_DbPINVOKE.OdDbFullSubentPath_objectIds__SWIG_0(this.swigCPtr, OdDbObjectIdArray.getCPtr(objectIdsArg));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbFullSubentPath Assign(OdDbFullSubentPath fullSubentPath)
		{
			OdDbFullSubentPath result = new OdDbFullSubentPath(TD_DbPINVOKE.OdDbFullSubentPath_Assign(this.swigCPtr, OdDbFullSubentPath.getCPtr(fullSubentPath)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdDbFullSubentPath fullSubentPath)
		{
			bool result = TD_DbPINVOKE.OdDbFullSubentPath_IsEqual(this.swigCPtr, OdDbFullSubentPath.getCPtr(fullSubentPath));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new OdDbObjectIdArray objectIds()
		{
			OdDbObjectIdArray result = new OdDbObjectIdArray(TD_DbPINVOKE.OdDbFullSubentPath_objectIds__SWIG_1(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new OdDbSubentId subentId()
		{
			OdDbSubentId result = new OdDbSubentId(TD_DbPINVOKE.OdDbFullSubentPath_subentId__SWIG_0(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
